package main

import (
	"bytes"
	"fmt"
	"log"
	"log/syslog"
)

func main() {
	l, err := syslog.NewLogger(syslog.LOG_INFO|syslog.LOG_DEBUG|syslog.LOG_SYSLOG, 0)
	if err != nil {
		log.Fatal(err)
	}
	var out bytes.Buffer
	//设置output
	l.SetOutput(&out)

	//写入数据
	l.Print("hello, world")
	//读取数据
	fmt.Printf("%v", &out)
}
